package com.citydo.webrtcspringboot.websocket.stream;

import javax.websocket.Session;
import java.util.ArrayList;
import java.util.List;

public class ConnectState{
    private String connectionId = null; //当前session的ConnectionID
    private Session session = null;
    //是否繁忙
    private Boolean isConnected = false;
    private String identity = null;
    private int connectNum = 0;
    private UserGrade userGrade = UserGrade.SharedGroup;

    public ConnectState(String connectionId,Session session,String identity,Boolean isConnected){
        this.connectionId = connectionId;
        this.session = session;
        this.isConnected = isConnected;
        this.identity = identity;
    }
    public ConnectState(String connectionId,Session session,String identity,Boolean isConnected,UserGrade userGrade){
        this.connectionId = connectionId;
        this.session = session;
        this.isConnected = isConnected;
        this.identity = identity;
        this.userGrade = userGrade;
    }
    public ConnectState(String connectionId,Session session,String identity){
        this.connectionId = connectionId;
        this.session = session;
        this.identity = identity;
    }
    public ConnectState(String connectionId,Session session,String identity,UserGrade userGrade){
        this.connectionId = connectionId;
        this.session = session;
        this.identity = identity;
        this.userGrade = userGrade;
    }
    public ConnectState(){
    }

    public UserGrade getUserGrade() {
        return userGrade;
    }

    public void setUserGrade(UserGrade userGrade) {
        this.userGrade = userGrade;
    }

    public String getConnectionId() {
        return connectionId;
    }

    public void setConnectionID(String connectionID) {
        this.connectionId = connectionId;
    }

    public Boolean getConnectionState() {
        return isConnected;
    }

    public void setConnectionState(Boolean isConnected) {
        this.isConnected = isConnected;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }
    public String toString(){
        return "{connectionID:"+connectionId+ " isConnected:"+isConnected+
                " session:"+ session+" identity:"+identity+"}";
    }

    public int getConnectNum() {
        return connectNum;
    }

    public void setConnectNum(int connectNum) {
        this.connectNum = connectNum;
    }
    public String ToString(){
        return "connectionId:"+this.connectionId+" connectNum:"+connectNum+
                " identity:"+identity+" userGrade:"+userGrade+" isConnected:"+isConnected;
    }
}


